function ModuleUser(){
	console.log( "[ModuleUser]" );
}

ModuleUser.prototype.initialize = function(){
	console.log( "[ModuleUser.initialize]" );
	this.bind();
	$.ajax({
		type: "POST",
		url: "/pelotero/user/home/calendar.do",
		dataType: "text",
		error: function(){
			$("#message").html( "error" );
		},
		success: function( data ){
			$("#center").html( data );
		}
	});
}

ModuleUser.prototype.bind = function(){
	console.log( "[ModuleUser.bind]" );
	$("#logout").click( function(){
		console.log( "[ModuleUser.logout]" );
		$.ajax({
			type: "POST",
			url: "/pelotero/logout.do",
			success: function( data ){
				window.location = data;
			}
		});
	});
}

ModuleUser.prototype.showCalendar = function(){
	console.log( "[ModuleUser.showCalendar]" );
	$.ajax({
		type: "POST",
		url: "/pelotero/user/home/calendar/content.do",
		dataType: "text",
		error: function(){
			$("#message").html( "error" );
		},
		success: function( data ){
			$("#calendarForm").html( data );
		}
	});
}

var moduleUser = new ModuleUser();
